﻿using Backup.Services.Entities;

namespace Backup.Services.Logic.Authentification
{
    public static class AuthentificationHelper
    {
        /// <summary>
        /// Authentificate user based on the given credentials.
        /// </summary>
        /// <param name="credentials">The given credentials.</param>
        public static void AuthentificateUser(Credentials credentials)
        {
            IMembershipService membershipService = new AccountMembershipService();

            if (membershipService.ValidateUser(credentials.User, credentials.Password))
            {
                new FormsAuthenticationService().SignIn(credentials.User, false);
            }
        }
    }
}
